<template>
  <div>
    <div class="block">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-sizes="[2, 5, 8, 10,15]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="num"
      >
      </el-pagination>
    </div>
  </div>
</template>
<script>
  export default {
    props:['num','currentPage','pageSize'],  
    methods: {
      //每页显示条数
      handleSizeChange(val) {
        //子传父:自定义事件
        this.$emit('changeSize',val);
      },
      //当前页
      handleCurrentChange(val) {
        this.$emit('changeCurrent',val);
      }
    },
    data() {
      return {
        currentPage1: 5,
        currentPage2: 5,
        currentPage3: 5,
        currentPage4: 4
      };
    }
  }
</script>